package com.neusoft.mapper;

import com.neusoft.po.Credit;
import org.apache.ibatis.annotations.*;

import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import java.nio.charset.CodingErrorAction;

@Mapper
public interface CreditMapper {

    //更新积分数量
    @Update("update credit set number=#{number} where userId=#{userId}")
    public int updateCreditNumberByUserId(String userId,int number);

    @Select("select number from credit where userId=#{userId}")
    public int getTotalCreditByUserId(String userId);

    @Insert("insert into credit (userId, number) values(#{userId}, 0)")
    public int insertCredit(String userId);

}
